﻿using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using EasyXaf.ObjectSpaces.OData;

namespace EasyXaf.Sample.Module.BusinessObjects;

[DomainComponent]
[DefaultClassOptions]
[Microsoft.OData.Client.EntitySet("Companies")]
public class Company : ODataObject<Guid>
{
    public string Name
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    [Aggregated]
    public IList<Department> Departments
    {
        get => GetCollection<Department>();
    }

    public Company()
    {
        Id = Guid.NewGuid();
    }
}
